package comjava;

public class Main {
//    启动一个线程，每隔 2 秒钟打印 指定的内容，10 秒之后关闭线程
    public static void main(String[] args) {
        RunnableDayin threadDayin = new RunnableDayin(" 伟大的祖国 ");
        Thread  t1 = new Thread(threadDayin);
        t1.setName("打印机2");
        t1.start();




       try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        threadDayin.close();
        System.out.println("拜拜！");

    }
}
